package cn.waxcc.controller;

import cn.waxcc.pojo.HrsRegisterNew;
import cn.waxcc.service.HrsRegisterNewService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: springboot-medicalapp
 * @ClassName HrsRegisterNewController
 * @description:
 * @author: JYF
 * @create: 2023-04-17 20:54
 * @Version 1.0
 */
@Controller
@CrossOrigin(origins = "*")
@RequestMapping("/hrsRegNew")
public class HrsRegisterNewController {

    @Autowired
    private HrsRegisterNewService hrsRegisterNewService;

    @GetMapping("/findAllReg")
    @ResponseBody
    public List<HrsRegisterNew> findAllReg() {
        return hrsRegisterNewService.findAllReg();
    }

    @PostMapping("/insertReg")
    @ResponseBody
    public int inset(HrsRegisterNew hrsRegisterNew) {
        int integer = hrsRegisterNewService.inset(hrsRegisterNew);
        return integer;
    }

    @PostMapping("/delete")
    @ResponseBody
    public int delete(Integer rId){
        int delete = hrsRegisterNewService.delete(rId);
        return delete;
    }
}
